package com.buyu.mvvm.mvvm.viewmodel;

import android.app.Application;
import android.arch.lifecycle.AndroidViewModel;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.ViewModel;
import android.support.annotation.NonNull;

import com.buyu.mvvm.mvvm.di.DataException;

import dagger.android.AndroidInjection;

/**
 * Created by cui-hl on 2018/09/17.
 */

public class BaseViewModel extends AndroidViewModel {


    protected MutableLiveData<DataException> errorLiveData = new MutableLiveData<>();

    public BaseViewModel(@NonNull Application application) {
        super(application);
    }

    public MutableLiveData<DataException> getErrorLiveData() {
        return errorLiveData;
    }


    @Override
    protected void onCleared() {
        errorLiveData=null;
    }
}
